package co.edu.uniquindio.ingesis.ventana;

import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

import javax.swing.JTabbedPane;
import javax.swing.SwingUtilities;


/**
* This code was edited or generated using CloudGarden's Jigloo
* SWT/Swing GUI Builder, which is free for non-commercial
* use. If Jigloo is being used commercially (ie, by a corporation,
* company or business for any purpose whatever) then you
* should purchase a license for each developer using Jigloo.
* Please visit www.cloudgarden.com for details.
* Use of Jigloo implies acceptance of these licensing terms.
* A COMMERCIAL LICENSE HAS NOT BEEN PURCHASED FOR
* THIS MACHINE, SO JIGLOO OR THIS CODE CANNOT BE USED
* LEGALLY FOR ANY CORPORATE OR COMMERCIAL PURPOSE.
*/
public class VentanaPrincipal extends javax.swing.JFrame implements ActionListener
{

	private PanelQuestion miPQuestion;
	private PanelMultiChoiceQuestion miMulti;
	private PanelChoiceQuestion miChoiceQ;
	private PanelFillInQuestion miFillIn;
	private PanelFreeQuestion miFreeQuestion;
	private PanelNumericQuestion miNumericQuestion;
	//private PanelMultiChoiceQuestion miMultiChoiceQuestion;
	private static final long serialVersionUID = 1L;
	private JTabbedPane miTabbedPane= new JTabbedPane();
	

	/**
	* Auto-generated main method to display this JFrame
	*/
	public static void main(String[] args) {
		SwingUtilities.invokeLater(new Runnable()
		{
			public void run() {
				VentanaPrincipal inst = new VentanaPrincipal();
				inst.setLocationRelativeTo(null);
				inst.setVisible(true);
			}
		});

	}
	
	public VentanaPrincipal() 
	{
		super();

		miTabbedPane.setBounds(16, 16, 750, 300);
		add(miTabbedPane);
		{
			miPQuestion= new PanelQuestion();
			miChoiceQ = new PanelChoiceQuestion();
			miFillIn = new PanelFillInQuestion();
			miFreeQuestion = new PanelFreeQuestion();
			miNumericQuestion = new PanelNumericQuestion(this);
			miMulti = new PanelMultiChoiceQuestion(this);
			miTabbedPane.addTab("miPQuestion",  miPQuestion);
			miTabbedPane.addTab("choice", miChoiceQ);
			miTabbedPane.addTab("fill in question", miFillIn);
			miTabbedPane.addTab("Free question", miFreeQuestion);
			miTabbedPane.addTab("numeric question", miNumericQuestion);
			miTabbedPane.addTab("multi choice question", miMulti);
			miPQuestion.setPreferredSize(new java.awt.Dimension(455, 149));
		}
		setTitle("Cuestionario");
		setSize(800, 400);
		setVisible(true);
	}

	@Override
	public void actionPerformed(ActionEvent e) 
	{	
		miTabbedPane.add(miPQuestion);
		miTabbedPane.add(miChoiceQ);
		miTabbedPane.add(miFillIn);
		miTabbedPane.add(miFreeQuestion);
		miTabbedPane.add(miNumericQuestion);
		//miTabbedPane.add(miMultiChoiceQuestion);
	
		if (e.getSource()==miTabbedPane)
		{	
			add( new PanelQuestion());
			add(new PanelChoiceQuestion());
			add(new PanelFillInQuestion());
			add(new PanelFreeQuestion());
			add(new PanelNumericQuestion(this));
			//add(new PanelMultiChoiceQuestion(this));
			
		}
		
	}

}
